package chain_of_responsibility

import "fmt"

type SizeHandler struct {
	next Handler
}

func NewSizeHandler(next Handler) Handler {
	return &SizeHandler{next: next}
}

func (h *SizeHandler) HandleRequest(req *OrderRequest) {
	fmt.Printf("SizeHandler execute......size = %d\n", req.Size)
	if h.next != nil {
		h.next.HandleRequest(req)
	}
}
func (h *SizeHandler) SetNext(handler Handler) {
	h.next = handler
}
